package com.qianxun.ini;


import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.util.Properties;

import com.qianxun.iservers.IServer;
import com.qianxun.servers.MyServer;

public class IniServer {
	private Properties p;
	private IServer myServer;
	public void Ini(){
		myServer = new MyServer();
		try {
			LocateRegistry.createRegistry(myServer.myServerCfg.getHostPort());
			System.out.println(myServer.myServerCfg.getName());
			Naming.rebind(myServer.myServerCfg.getName(), myServer);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
